# Contributor: Andy Postnikov <apostnikov@gmail.com>
# Maintainer: Andy Postnikov <apostnikov@gmail.com>

pkgname=php7-pecl-smbclient
_extname=smbclient
pkgver=1.0.6
pkgrel=0
pkgdesc="PHP 7 extension that uses Samba's libsmbclient library to provide Samba related functions and 'smb' streams to PHP programs."
url="https://pecl.php.net/package/smbclient"
arch="all"
license="BSD-2-Clause"
depends="php7-common"
makedepends="php7-dev samba-dev"
source="php-pecl-$_extname-$pkgver.tgz::https://pecl.php.net/get/$_extname-$pkgver.tgz"
builddir="$srcdir"/$_extname-$pkgver

build() {
	phpize7
	./configure --prefix=/usr --with-php-config=php-config7
	make
}

check() {
	# Test suite require phpunit to run.
	php7 -d extension=modules/$_extname.so --ri smbclient
}

package() {
	make INSTALL_ROOT="$pkgdir" install
	local _confdir="$pkgdir"/etc/php7/conf.d
	install -d $_confdir
	echo "extension=$_extname" > $_confdir/$_extname.ini
}

sha512sums="381051dbe6347ce3b0be9d1ed44ee80be846ce1cd4255689127220a48e3c157853e98ae463435a12342f6370b4e96c162069d8d00574aaf88675c5b9ad0810e8  php-pecl-smbclient-1.0.6.tgz"
